package com.company.cloud.page.modules.api.service;

import com.company.cloud.common.bean.BaseClientResult;
import com.company.cloud.page.modules.api.fallback.PageComponentClientServiceFallbackFactory;
import com.company.cloud.page.modules.api.models.PageComponentModel;
import com.company.cloud.page.modules.api.request.*;
import com.company.cloud.page.modules.api.response.PageComponentPageResponse;
import com.company.common.server.constant.ServiceNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@Deprecated
@FeignClient(contextId="pageComponent", name = ServiceNameConstant.cms_center, fallbackFactory = PageComponentClientServiceFallbackFactory.class )
public interface PageComponentClientService {

    /** 保存组件信息 */
    @RequestMapping(value = "/remote/pageComponent/save", method = RequestMethod.POST)
    public BaseClientResult<String> save(@RequestBody PageComponentSave2UpdateRequest params);

    /** 更新组件信息 */
    @RequestMapping(value = "/remote/pageComponent/update", method = RequestMethod.POST)
    public BaseClientResult<String> update(@RequestBody PageComponentSave2UpdateRequest params);

    /** 更新组件上下架信息 */
    @RequestMapping(value = "/remote/pageComponent/updateState", method = RequestMethod.POST)
    public BaseClientResult<String> updateState(@RequestBody PageComponentUpdateStateParam params);

    /** 删除组件信息 */
    @RequestMapping(value = "/remote/pageComponent/delete", method = RequestMethod.POST)
    public BaseClientResult<String> delete(@RequestBody PageComponentDeleteRequest params);

    /** 查询组件列表 */
    @RequestMapping(value = "/remote/pageComponent/query", method = RequestMethod.POST)
    public BaseClientResult<PageComponentPageResponse> query(@RequestBody PageComponentQueryParam params);

    /** 查询组件信息 */
    @RequestMapping(value = "/remote/pageComponent/getById", method = RequestMethod.GET)
    public BaseClientResult<PageComponentModel> getById(@RequestParam("code") String code);

}
